const express = require("express");
const router = express.Router();
const pool = require("../../../src/pg/config/pg");
//删除数据
router.get("/del/:id", async (req, res) => {
    await pool.query(
      "delete from chat where name = $1",
      [req.params.id],
      (err) => {
        if (err) {
          res.status(200).json({ id: "1", name: "删除数据失败" });
          pool.end;
        } else {
          res.status(200).json({ id: "1", name: "删除数据成功" });
          pool.end;
        }
      }
    );
  });
  
module.exports = router